<?php
require_once(dirname(dirname(__FILE__)) . '/app.php');


$searchDate = $_GET['start_date'];
$getDateArray = array();
if( preg_match("#/#", $searchDate) ){
	$getDateArray = explode("/", $searchDate);
}else if( preg_match("#-#", $searchDate) ){
	$getDateArray = explode("-", $searchDate);
}else{
	array_push($getDateArray, substr($searchDate, 0, 4));
	array_push($getDateArray, substr($searchDate, 4, 2));
	array_push($getDateArray, substr($searchDate, 6, 2));
}

$time['startYear'] = $getDateArray[0];
$time['startMonth'] = $getDateArray[1];
$time['startDay'] = $getDateArray[2];

$shopList = Shop::GetAllShops();

$serviceList = Service::GetAll();

$tmp_date=date("Ymd");
$tmp_year=substr($tmp_date,0,4) * 1;
$tmp_mon =substr($tmp_date,4,2) * 1;
$tmp_day = substr($tmp_date, 6, 2) * 1;

$time['startYear'] = $time['startYear'] > 0 ? $time['startYear'] : $tmp_year;
$time['startMonth'] = $time['startMonth'] > 0 ? $time['startMonth'] : $tmp_mon;
$time['startDay'] = $time['startDay'] > 0 ? $time['startDay'] : $tmp_day;

$logList = AccessHistory::GetList($time['startYear'], $time['startMonth'], $time['startDay'], $time['startDay']);





include template('service/access_history');
//include template('subscribe');
